package com.zhongjian.technologycal.mall.activity.main.activity;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.youth.banner.Banner;
import com.youth.banner.listener.OnBannerListener;
import com.youth.banner.transformer.DepthPageTransformer;
import com.zhongjian.technologycal.mall.R;
import com.zhongjian.technologycal.mall.base.BaseActivity;
import com.zhongjian.technologycal.mall.utils.PicassoImageLoader;


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by wei on 2017/11/9.
 * 保健品专区功能实现页面
 */

public class HealthCareProductsActivity extends BaseActivity {
    @BindView(R.id.iv_back_page)
    ImageView iv_back_page;
    @BindView(R.id.tv_main_title)
    TextView tv_main_title;
    @BindView(R.id.health_banner)
    Banner health_banner;

    private String[] urls = {
            "http://img.zcool.cn/community/01b72057a7e0790000018c1bf4fce0.png",
            "http://img.zcool.cn/community/01fca557a7f5f90000012e7e9feea8.jpg",
            "http://img.zcool.cn/community/01996b57a7f6020000018c1bedef97.jpg"
    };
    private List list = Arrays.asList(urls);
    private List arrayList = new ArrayList(list);

    @Override
    protected void beforeInit() {
        super.beforeInit();
//        StatusBarUtil.setColorNoTranslucent(this, getResources().getColor(R.color.border_color));
//        StatusBarUtil.setMiuiStatusBarDarkMode(this, true);

    }

    @Override
    public void initPresenter() {

    }

    @Override
    protected int getContentViewLayoutID() {
        return R.layout.activity_health_care_products;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        health_banner.setImages(arrayList)
                .setImageLoader(new PicassoImageLoader())
                .setOnBannerListener(new OnBannerListener() {
                    @Override
                    public void OnBannerClick(int position) {
                        Toast.makeText(getBaseContext(), "" + position, Toast.LENGTH_SHORT).show();
                    }
                })
                .start();
        health_banner.setBannerAnimation(DepthPageTransformer.class);
        tv_main_title.setText("保健品专场");
    }

    @OnClick(R.id.iv_back_page)
    public void backAppPage() {
        finish();
    }


}
